<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
<input type="hidden" name="zh_parsen/fzr_mobile"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
<input type="hidden" name="zh_parsen/fzr_tel"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
<input type="hidden" name="zh_parsen/fzr_email"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
<div class="t_bar">项目基本情况</div>
<table class="t_css" width="100%" id="table_01">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />

    <tr>
        <td align="right"><span class="color_red">*</span>孵化器名称：</td>
        <td >
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 81%"
                class=" required" maxlength="50"
                value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="孵化器名称">
        </td>
          <td align="right"><span class="color_red">*</span>申报日期：</td>
        <td>
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date" />
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}"
                className="required date" label="申报日期"></cpt:date>
        </td>
    </tr>

    <tr>
		<td align="right"><span class="color_red">*</span>孵化器性质：</td>
 		 <td colspan="5" align="center">
 		    <c:set var="fuhuaqi_nature_nomjzz_value">
                <x:out select="$xmlData/data/proposal/fuhuaqi_nature_nomjzz_value" />
            </c:set>
             <c:set var="fuhuaqi_nature_nomjzz_other">
                <x:out select="$xmlData/data/proposal/fuhuaqi_nature_nomjzz_other" />
            </c:set>
            <cpt:checkbox key="fuhuaqi_xingzhinomjzz" style="float:left;"
                name="fuhuaqi_nature_nomjzz" width="140px" repeatColumn="3"
                value="${fuhuaqi_nature_nomjzz_value }" lastOther="true" otherId="fuhuaqi_nature_nomjzz_other"  otherValueName="${fuhuaqi_nature_nomjzz_other }" tagType="radio"></cpt:checkbox>
            <input type="text" id="fuhuaqi_nature_nomjzz_other" 
                name="proposal/fuhuaqi_nature_nomjzz_other" label="孵化器性质-->其他" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_nomjzz_other" />" />       
            <input type="hidden" id="fuhuaqi_nature_nomjzz_value"
                name="proposal/fuhuaqi_nature_nomjzz_value" class="required"
                value="${fuhuaqi_nature_nomjzz_value }" label="孵化器性质">
            <input type="hidden" id="fuhuaqi_nature_nomjzz_name"
                name="proposal/fuhuaqi_nature_nomjzz"
                value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_nomjzz_value" />">

          </td>
	</tr>
     <tr >
        <td align="right"><span class="color_red">*</span>孵化器类型：</td>
        <td  align="center" >
             <c:set var="incubator_type"><x:out select="$xmlData/data/proposal/incubator_type" /></c:set>
			  <cpt:checkbox key="incubator_type" name="incubator_type"  value="${incubator_type }" width="80px;" repeatColumn="4" tagType="radio" ></cpt:checkbox>
		  	  <input type="hidden" id="incubator_type_value" name="proposal/incubator_type_value"  class="required"  value="<x:out select="$xmlData/data/proposal/incubator_type_value" />" label="孵化器类型">
		  	  <input type="hidden" name="proposal/incubator_type_name" value="<x:out select="$xmlData/data/proposal/incubator_type_name" />">
        </td>
        <td align="right"><span class="color_red">*</span>组织机构代码：</td>
        <td >
            <input type="text" label="组织机构代码" name="proposal/org_code"
               class="required orgCard  input_text"  maxlength="11"   id="rogcode"
                value="<x:out select="$xmlData/data/proposal/org_code" />">
        </td>
    </tr>
    <tr>
    	
        <td align="right"><span class="color_red">*</span>法定代表人：</td>
        <td >
            <input type="text" label="法人代表" name="proposal/legal_representative"
                class=" required"  maxlength="11"
                value="<x:out select="$xmlData/data/proposal/legal_representative" />">
        </td>
        <td align="right"><span class="color_red">*</span>性别：</td>
        <td > 
              <c:set var="sex"><x:out select="$xmlData/data/proposal/sex_value" /></c:set>       
                <cpt:select id="sex_one" key="gender"  className="input_css" name="sex"
				                       onChange="initControlValue(this.id);" value="${sex }" style="width:151px;"><x:out select="$xmlData/data/proposal/sex_value" /></cpt:select>
                <input type="hidden" name="proposal/sex_value" value="<x:out select="$xmlData/data/proposal/sex_value" />" class="input_text required" label="性别"/>
                <input type="hidden" name="proposal/sex_name" value="<x:out select="$xmlData/data/proposal/sex_name" />" /> 
           
        </td>
    </tr>
    <tr>
    	
        <td align="right"><span class="color_red">*</span>学历：</td>
        <td >
        <c:set var="education"><x:out select="$xmlData/data/proposal/education_value" /></c:set>
        <cpt:select id="education_one" key="educate"  className="input_css" name="education"
				                       onChange="initControlValue(this.id);" value="${education }" style="width:151px;"></cpt:select>
				           <input type="hidden" name="proposal/education_value" value="<x:out select="$xmlData/data/proposal/education_value" />" class="input_text required" label="学历"/>
				        
                           <input type="hidden" name="proposal/education_name" value="<x:out select="$xmlData/data/proposal/education_name" />" /> 
       
        </td>
        <td align="right"><span class="color_red">*</span>职称：</td>
        <td >
           
            <c:set var="prof_title">{'id':'<x:out
                    select="$xmlData/data/proposal/prof_title_value" />','name':'<x:out
                    select="$xmlData/data/proposal/prof_title_name" />'}</c:set>
            <cpt:tree key="prof_title" cacheable="false" className="hn_iuput_kuang "
                readonly="true" value="${prof_title}" label="职称" id="prof_title"
                onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true"
                onClick="initTreeValueExt" />
            <input type="hidden" id="prof_title_value" name="proposal/prof_title_value"
                class="required"
                value="<x:out select="$xmlData/data/proposal/prof_title_value" />" label="职称">
            <input type="hidden" name="proposal/prof_title_name"
                value="<x:out select="$xmlData/data/proposal/prof_title_name" />">
            
           
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>注册时间：</td>
        <td >
            <c:set var="register_date">
                <x:out select="$xmlData/data/proposal/register_date" />
            </c:set>
            <cpt:date id="register_date_curr" name="proposal/register_date" value="${register_date}"
               className="required date" label="注册时间"></cpt:date>
        </td>
         <td align="right"><span class="color_red">*</span>注册资本(万元)：</td>
        <td >
             <input type="text" label="注册资本" name="proposal/registered_capital"
                class=" required" maxlength="50"  onfocus="InitInput.setNumber(this,9,2,2)"
                	style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/registered_capital" />">
        </td>
    </tr>

    <tr>
       <td align="right"><span class="color_red">*</span>联系人姓名：</td>
        <td >
             <input type="text" label="联系人姓名" name="proposal/contacts_name"
                class=" required" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/contacts_name" />">
        </td>
        <td align="right"><span class="color_red">*</span>联系人手机：</td>
        <td>
            <input type="text" label="联系人手机" name="proposal/contacts_mobile"
                class=" required mobile" onfocus="InitInput.setNumber(this,11,0,0)"
                maxlength="11"
                value="<x:out select="$xmlData/data/proposal/contacts_mobile" />">
        </td>
    </tr>
    <tr>
       <td align="right"><span class="color_red">*</span>邮箱：</td>
        <td >
            <input type="text" label="邮箱" name="proposal/contacts_email"
                class="required email" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/contacts_email" />">
        </td>
        <td align="right"><span class="color_red">*</span>通讯地址：</td>
       
        <td>
            <input type="text" label="通讯地址" name="proposal/contacts_address"
                class="required "  maxlength="100"
                value="<x:out select="$xmlData/data/proposal/contacts_address" />">
        </td>
    </tr>
    </table>
   <table class="t_css" width="100%" id="table_04">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />
    
	<tr>
       <td align="right"><span class="color_red">*</span>孵化器建设总投资(万元)：</td>
        <td>
            <input type="text" label="孵化器建设总投资金额" name="proposal/overall_investment" id="research_team_money_num"
                class="required " onfocus="InitInput.setNumber(this,9,2,2)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/overall_investment" />">
        </td>
        <td align="right"><span class="color_red">*</span>其中:政府投资(万元)：</td>
        <td>
            <input type="text" label="其中政府投资金额" name="proposal/government_investment" id="research_team_money_zf"
                class="required " onfocus="InitInput.setNumber(this,9,2,2)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/government_investment" />">
        </td>
    </tr>
    </table>
<table class="t_css" width="100%" id="table_05">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />
   
    <tr>
       <td align="right"><span class="color_red">*</span>孵化器专职服务人员(人)：</td>
        <td > 
            <input type="text" label="孵化器专职服务人员" name="proposal/number_managers" style="text-align: right;"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)"
                value="<x:out select="$xmlData/data/proposal/number_managers" />">
        </td>
        <td align="right"><span class="color_red">*</span>其中：大专以上学历(人)：</td>
        <td>
            <input type="text" label="孵化器专职服务人员中大专以上学历" name="proposal/managers_college_degree_above"
                class="required " onfocus="InitInput.setNumber(this,9,0,0)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/managers_college_degree_above" />">
        </td>
    </tr>
    
    
   </table> 
    
    <table class="t_css" width="100%" style="text-align: center;" id="table_08">
    <col style="width: 20%;" />
    <col style="width: 30%;" />
    <col style="width: 20%;" />
    <col style="width: 30%;" />
    <tr>
        <td align="right" rowspan="5">
          <span class="color_red">*</span>孵化器场地(平方米)：<br/>
        </td>
        <td align="center" colspan="2">
        	孵化器场地面积：<br/>
        </td>
        <td align="left">
        	<input type="text" name="proposal/area_sum" readonly="readonly" id="area_sum"  class="gray"
                 label="孵化器场地面积"   style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/area_sum"/>" /> 
        </td>
    </tr>
    <tr>
    	<td rowspan="4" align="center">其中:</td>
    	<td align="right" >
        	<span class="color_red">*</span>办公用房：<br/>
        </td>
        <td align="left">
     
        	<input type="text" name="proposal/area_work" class="required" id="area_work"
                 label="孵化器场地-->办公用房" onfocus="InitInput.setNumber(this,9,2,2)"
                style="text-align: right;"
                onchange="countFundAuto('area_','work,incubated,common,other','sum');"
                value="<x:out select="$xmlData/data/proposal/area_work"/>" />
        </td>
    </tr>
    <tr>
    	<td align="right" >
        	<span class="color_red">*</span>在孵企业用房：<br/>
        </td>
        <td align="left">
      
        	<input type="text" name="proposal/area_incubated" class="required" id="area_incubated"
                label="孵化器场地-->在孵企业用房" onfocus="InitInput.setNumber(this,9,2,2)"
                style="text-align: right;"
                onchange="countFundAuto('area_','work,incubated,common,other','sum');"
                value="<x:out select="$xmlData/data/proposal/area_incubated"/>"/>
        </td>
    </tr>
    <tr>
    	<td align="right" >
        	<span class="color_red">*</span>公共服务用房：<br/>
        </td>
        <td align="left">
                      
        	<input type="text" name="proposal/area_common" class="required" id="area_common"
                 label="孵化器场地-->公共服务用房" onfocus="InitInput.setNumber(this,9,2,2)"
                style="text-align: right;"
                onchange="countFundAuto('area_','work,incubated,common,other','sum');"
                value="<x:out select="$xmlData/data/proposal/area_common"/>" />
        </td>
    </tr>
    <tr>
    	<td align="right" >
        	<span class="color_red">*</span>其他：<br/>
        </td>
        <td align="left">
        	<input type="text" name="proposal/area_other" class="required" id="area_other"
                 label="孵化器场地-->其他" onfocus="InitInput.setNumber(this,9,2,2)"
                style="text-align: right;"
                onchange="countFundAuto('area_','work,incubated,common,other','sum');"
                value="<x:out select="$xmlData/data/proposal/area_other"/>" />
        </td>
    </tr>
   </table>
    
    <table class="t_css" width="100%" id="table_09">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />
     <tr>
       <td align="right"><span class="color_red">*</span>在孵企业从业人员(人)：</td>
        <td > 
            <input type="text" label="在孵企业从业人员" name="proposal/number_enterprise" style="text-align: right;"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)"
                value="<x:out select="$xmlData/data/proposal/number_enterprise" />">
        </td>
        <td align="right"><span class="color_red">*</span>其中：大专以上学历(人)：</td>
        <td>
            <input type="text" label="在孵企业从业人员中大专以上学历" name="proposal/enterprise_college_degree_above"
                class="required " onfocus="InitInput.setNumber(this,9,0,0)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/enterprise_college_degree_above" />">
        </td>
    </tr>
    
    
    <tr>
       <td align="right"><span class="color_red">*</span>在孵企业数：</td>
        <td >
            <input type="text" label="在孵企业数" name="proposal/incubating_enterprises"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)"
                value="<x:out select="$xmlData/data/proposal/incubating_enterprises" />" style="text-align: right;">
        </td>
     <td align="right"><span class="color_red">*</span>归口管理部门：</td>
     <td>
            <c:set var="recomend_org">{'id':'<x:out
                    select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out
                    select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang "
                readonly="true" value="${recomend_org}" label="归口管理部门" id="recomend_org"
                onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true"
                onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"
                class="required"
                value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name"
                value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
       </td>
            
        </tr>
</table>

<table class="t_css" width="100%" style="text-align: center;" id="table_10">
    <col style="width: 20%;" />
    <col style="width: 80%;" />
    <tr>
        <td align="right">
          <span class="color_red">*</span>项目简述：<br />（限280字）
        </td>
        <td>
            <textarea name="proposal/prj_brief" class="input_textarea required maxlength:280"
                label="项目简述" style="width: 98%" rows="9"><x:out
                    select="$xmlData/data/proposal/prj_brief" /></textarea>
            <input type="hidden" name="proposal/prj_brief_hidden" value=""/>
        </td>
    </tr>
</table>


<script type="text/javascript">
//文本框只显示下边框
$(".survey").css({
	"border":"none",
	"border-bottom":"1px solid black",
	"text-align":"right",
	"width":30
});


/* var operation_subject4 = '<span><input type="text" label="其他" id="radio4" style="height: 17px;width: 70px;border: none;border-bottom: 1px solid gray;" maxlength="10" class="required" value="" onblur="setValByRadio4();" /></span>';
if($('input:radio[name="fuhuaqi_nature_nomjzz"]:checked').val()==4){
	$("input[name='fuhuaqi_nature_nomjzz']").parent().parent().parent().find('td').last('label').append(operation_subject4);
	var radio4_hidden = $("#fuhuaqi_nature_nomjzz_other").val();
	$("#radio4").val(radio4_hidden);
	$("#fuhuaqi_nature_nomjzz_other").addClass("required");
}

//对radio须注明选项的值进行复制
function setValByRadio4(){
    var radio4 = $("#radio4").val();
    $("#fuhuaqi_nature_nomjzz_other").val(radio4);
}

//当运营主体性质被选中，则显示输入框
$("input[name='fuhuaqi_nature_nomjzz']").click(function(){
    var val=$('input:radio[name="fuhuaqi_nature_nomjzz"]:checked').val();
    if(val==4){
        if($(this).parent().parent().parent().find('span').length<=0){
            $(this).parent().parent().parent().find('td').last('label').append(operation_subject4);
            $("#fuhuaqi_nature_nomjzz_other").addClass("required");
        }
    } else{
    	$("#fuhuaqi_nature_nomjzz_other").removeClass("required");
    	$(this).parent().parent().parent().find('span').remove();
    }
}); */



$('#topic_level1_year1_count,#topic_level1_year2_count,#topic_level1_year3_count').change(function(){
	getTotalCount('topic_level1_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level1_year1_fund,#topic_level1_year2_fund,#topic_level1_year3_fund').change(function(){
	getTotalCount('topic_level1_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level2_year1_count,#topic_level2_year2_count,#topic_level2_year3_count').change(function(){
	getTotalCount('topic_level2_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level2_year1_fund,#topic_level2_year2_fund,#topic_level2_year3_fund').change(function(){
	getTotalCount('topic_level2_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level3_year1_count,#topic_level3_year2_count,#topic_level3_year3_count').change(function(){
	getTotalCount('topic_level3_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level3_year1_fund,#topic_level3_year2_fund,#topic_level3_year3_fund').change(function(){
	getTotalCount('topic_level3_','year1_fund,year2_fund,year3_fund','total_fund',true);
});

/*
----------------------by zk
        描述：计算数值总数
        参数prefix：公共的id开头
        参数count：需要加的数的id结尾     以,分割
        参数total：总数id结尾
        参数isDeciaml：是否为小数 默认为false
*/
/* $('#area_work,#area_incubated,#area_common,#area_other').change(function() {
	getTotalCount('area_', 'work,incubated,common,other', 'sum', true);
}); */

function getTotalCount(prefix,count,total,isDecimal){
  var defaultIsDecimal = false;//默认为整数
  if(isDecimal==null){
        isDecimal = defaultIsDecimal;
  }
  var numStr = count.split(',');
  var totalCount = 0;//总数
  if(!isDecimal){
        for ( var int = 0; int < numStr.length; int++) {
             var num = $('#'+prefix+numStr[int]).val();
             if(!$.isNumeric(num))
                  num = "0";
             totalCount += parseInt(num);
       }
  }else {
     for ( var int = 0; int < numStr.length; int++) {
         var num = $('#'+prefix+numStr[int]).val();
         if(!$.isNumeric(num))
             num = "0";
         totalCount += parseFloat(num);
     }
     totalCount = ((totalCount*10000)/10000).toFixed(2);
     

     
  }
  if(totalCount == 0){
        $('#'+prefix+total).val("");
  }else {
        $('#'+prefix+total).val(totalCount);
  }
}
$("table.t_css").each(function(){  
    $(this).find("tr").not(".cbTable tr").filter(":even").addClass("li_1");
    $(this).find("tr").not(".cbTable tr").filter(":odd").addClass("li_2");
});


function changeFhq(){
	if ($("input[id$='other03']").prop('checked')){
		$("input[id$='fuhuaqi_nature_nomjzz_other']").removeAttr("class");
		$("input[id$='fuhuaqi_nature_nomjzz_other']").css("display","block");
		$("input[id$='fuhuaqi_nature_nomjzz_other']").addClass("required");
	}else{
 		$("input[id$='fuhuaqi_nature_nomjzz_other']").css("display","none");
		$("input[id$='fuhuaqi_nature_nomjzz_other']").removeAttr("class");
 		$("input[id$='fuhuaqi_nature_nomjzz_other']").css("display","none");
		$("input[id$='fuhuaqi_nature_nomjzz_other']").removeAttr("class");
		$("input[id$='fuhuaqi_nature_nomjzz_other']").val(" ");
	}
}
function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
}

//--------------------计算总数------------------begin
/* $('#area_work,#area_incubated,#area_common,#area_other').change(function() {
	getTotalCount('area_', 'work,incubated,common,other', 'sum');
}); */

function initControlValue(objId){
    
    var name="";
    var obj=$("#"+objId);
    if(obj.is("select")){
        name=obj.attr("name");
        obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
        $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
    }
   
    else if(obj.is(":radio")){
        name=obj.attr("name");
        if(obj.is(":checked")){//如果被选中
            //alert($("#"+objId).val());        
            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
            $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).next().text());
        }
        else{
            
            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
        }
    }else if(obj.is(":checkbox")){
        name=obj.attr("name");
        if(obj.is(":checked"))//如果被选中
            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
        else
            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
    }else{
        name=obj.attr("id");
        obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
        obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
    }   
}
function initTreeValueExt1(treeId, treeNode) {
	   
	  if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
		}
		
		return false;
		}
	
	
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}
		
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
		
	}
	
function countFundAuto(idStart, countStr, totalStr) {
	var indexs = countStr.split(",");
	var count = 0;
	for ( var i = 0; i < indexs.length; i++) {
		var fund = $("#" + idStart + indexs[i]).val();
		if (!$.isNumeric(fund))
			fund = "0";
		count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(4);
	}
	count = formatNumberAuto(count.toString(), 9, 4, 2);// 格式化金额
	//add by cg 扩展：对于多个输入框所求得的和，同时赋给某几个文本框
	var totalStrArr = totalStr.split(",");
	var totalId;
	for(var i = 0;i < totalStrArr.length; i++ ) {
		totalId = totalStrArr[i];
	$("#" + idStart + totalId).val(count);
	}
};
</script>	